<template>
  <div class="filter">
    <div class="item">
      <div class="item-title">询价单号：</div>
      <el-input v-model="searchObj.orderId"></el-input>
    </div>
    <div class="item">
      <div class="item-title item-second">型号：</div>
      <el-input v-model="searchObj.model"></el-input>
    </div>
    <div class="item">
      <div class="item-title">询价类型：</div>
      <el-select v-model="searchObj.type" placeholder="请选择">
        <el-option
          v-for="item in options"
          :key="item.value"
          :label="item.label"
          :value="item.value"
        >
        </el-option>
      </el-select>
    </div>
    <div class="item">
      <div class="item-title">询价日期:</div>
      <myDate @getSelectData="getCreateDate" :createDate="searchObj.Date" />
      <!-- <el-date-picker
        style="width: 160px"
        v-model="searchObj.startTime"
        type="date"
        placeholder="开始日期"
      >
      </el-date-picker>
      <span class="sign">-</span>
      <el-date-picker
        style="width: 160px"
        v-model="searchObj.endTime"
        type="date"
        placeholder="结束日期"
      >
      </el-date-picker> -->
    </div>
    <div class="item filter-btn">
      <el-button @click="handleSearch()">搜索</el-button>
      <el-button @click="handleReset()">重置</el-button>
    </div>
  </div>
</template>

<script>
import myDate from "@/components/Date/index";
export default {
  name: "FilterSearch",
  components: {
    myDate,
  },
  data() {
    return {
      searchObj: {
        orderId: "",
        model: "",
        type: "",
        Date: [],
      },
      options: [
        {
          value: "选项1",
          label: "实单询价",
        },
        {
          value: "选项2",
          label: "普通询价",
        },
      ],
    };
  },
  methods: {
    getCreateDate(date) {
      this.searchObj.createDate = date;
    },
    handleReset() {
      this.searchObj.orderId = "";
      this.searchObj.model = "";
      this.searchObj.type = "";
      this.searchObj.Date = [];
    },
  },
  created() {},
};
</script>
<style lang="scss" scoped>
.filter {
  display: flex;
  .item {
    display: flex;
    flex: 1;
    align-items: center;
    .item-title {
      // display: inline-block;
      min-width: 80px;
      padding: 0 10px;
      margin-left: 10px;
      text-align: right;
    }
    .item-second {
      min-width: 60px;
    }
    .sign {
      margin: 0 10px;
    }
  }

  .filter-btn {
    margin-left: 20px;
    button {
      background-color: #442a8d;
      color: #ffffff;
    }
  }
}
</style>
